function Sprite(src,w,h,x,y){
  this.src = src;
  this.w = w;
  this.h = h;
  this.x = x;
  this.y = y;

  //创建一个img节点，之后把此节点添加到容器中。
  this.imgNode = document.createElement('img')

  this.imgNode.src = this.src;
  this.imgNode.style.position = 'absolute';
  this.imgNode.style.width = this.width + 'px';
  this.imgNode.style.height = this.height + 'px';
  this.imgNode.style.left = this.x + 'px';
  this.imgNode.style.top = this.y + 'px';
}

Sprite.prototype.die = function(){
  this.imgNode.parentNode.removeChild(this.imgNode)
}
